import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:xin_he/utils/xin_he_image.dart';
import 'package:xin_he/utils/xin_he_user_data.dart';

import '../../../utils/xh_styles.dart';
import 'xin_he_adopt_certificate_logic.dart';

class XinHeAdoptCertificatePage extends StatelessWidget {
  XinHeAdoptCertificatePage({Key? key}) : super(key: key);

  final logic = Get.put(XinHeAdoptCertificateLogic());
  final state = Get.find<XinHeAdoptCertificateLogic>().state;

  @override
  Widget build(BuildContext context) {
    return  Column(
      // crossAxisAlignment: CrossAxisAlignment.center,
    mainAxisAlignment: MainAxisAlignment.center,
    children: [

    RepaintBoundary(
      key: logic.globalKey,
      child: Stack(children: [

        const XinHeAssetImage('assets/images/adopt/adopt_cer.png',width: 270,height:382 ,),
        Positioned(
            top: 135,
            left: 75,
            child: Text(xinHeUserData.userDetailInfo.value?.name??''))
      ],),
    ),


      const SizedBox(height: 25,),
      Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
        Container(
          height: 37,
          width: 115,
          alignment: Alignment.center,
          decoration: BoxDecoration(color: Colors.white,borderRadius: BorderRadius.circular(18.5)),
          child: Text('分享',style: TextStyle(color: XinHeColor('#30E9E9'),fontSize: 15,fontWeight: FontWeight.bold),),
        ),
        const SizedBox(width:14 ,),
        GestureDetector(
          onTap: (){
            logic.saveScreenshot();
          },
          child: Container(
            height: 37,
            width: 115,
            alignment: Alignment.center,
            decoration: BoxDecoration(color:  XinHeColor('#30E9E9'),borderRadius: BorderRadius.circular(18.5)),
            child: const Text('保存',style: TextStyle(color: Colors.white,fontSize: 15,fontWeight: FontWeight.bold),),
          ),
        ),
      ],)
    ],);
  }
}
